package com.leo.apptest.activity;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.leo.apptest.R;
import com.leo.apptest.widget.FlowLayout;
import com.leo.apptest.widget.TagLayout;

public class FlowActivity extends AppCompatActivity {

    private FlowLayout mFlContent;
    private LinearLayout mLlFirst;
    private TagLayout mTagLayout;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_flow);

//        mFlContent = (FlowLayout) findViewById(R.id.flContent);
//        mFlContent.removeAllViews();
//        int i = 50;
//        int width = 0;
//        System.out.println("android width " + AndroidUtils.getDisplayHeight(this));
//        for (int i1 = 0; i1 < i; i1++) {
//            View view = View.inflate(FlowActivity.this, R.layout.row_question_tag, null);
//            TextView tvContent = (TextView) view.findViewById(R.id.tvContent);
//            if (i1 == 0) {
//                tvContent.setText("全部...");
//            } else if (i1 % 2 == 0) {
//                tvContent.setText("内容");
//            } else {
//                tvContent.setText("sdasdadasdadsa");.
//            }
//            mFlContent.addView(view);
//        }
        mTagLayout = (TagLayout) findViewById(R.id.tagLayout);
        int i = 30;
        for (int i1 = 0; i1 < i; i1++) {
            View view = View.inflate(FlowActivity.this, R.layout.row_question_tag, null);
            TextView tvContent = (TextView) view.findViewById(R.id.tvContent);
            if (i1 == i - 1) {
                tvContent.setText("全部...");
            } else if (i1 % 2 == 0) {
                tvContent.setText("内容");
            } else {
                tvContent.setText("sdkas");
            }
            mTagLayout.addView(view);
        }

    }
}
